<html>
    <body onLoad="writeYear(),writeYears();">

		<?php
		echo form_open('manager/leaving');
		$desc_catchup = array('name' => 'desc_up', 'value' => set_value('desc_up'));
		$reason = array('name' => 'reason', 'value' => set_value('reason'));
		$catch_on = array('name' => 'catchup_on', 'value' => set_value('catchup_on'));
		$working_on = array('name' => 'working_on', 'value' => set_value('working_on'));
		$start_date = array('name' => 's_date', 'value' => set_value('s_date'));
		$end_date = array('name' => 'e_date', 'value' => set_value('e_date'));
		$hours = array('0' => '--- Select ---', '4' => '4 Hours', '8' => '8 Hours', '12' => '12 Hours', '16' => '16 Hours');

		if ($this->session->userdata('send_request_erro')) {
			echo $this->session->userdata('send_request_erro');
			$this->session->unset_userdata('send_request_erro');
		} else if ($this->session->userdata('sent_erro')) {
			echo $this->session->userdata('sent_erro');
			$this->session->unset_userdata('sent_erro');
		} else if ($this->session->userdata('sending_erro')) {
			echo $this->session->userdata('sending_erro');
			$this->session->unset_userdata('sending_erro');
		} else if ($this->session->userdata('validate_fail')) {
			echo $this->session->userdata('validate_fail');
			$this->session->unset_userdata('validate_fail');
		}
		?>

        <div id="request-style-boder"> 
            <div id="request-style">
                <div class="request-style">
                    <strong class="form-request-heading">LEAVING REQUEST FORM</strong>
                    <hr style="margin-top:10px; height:2px;"/>
					<span><strong class="note">Note:</strong> All <span class="star">*</span> fields are required!</span>
                    <table>
						<tbody>
							<tr>
								<td class="txt">Manager Mail<span class="star">*</span></td>
								<td class="txt1">:</td>
								<td class="input_txt">
									<?php
									echo form_dropdown('validators', $validator, set_value('validators'), 'class="span3"') . form_error('validators', '<span class="req-error">', '</span>');
									?>
								</td>
							</tr>
							<tr>
								<td class="txt">List Category<span class="star">*</span></td>
								<td class="txt1">:</td>
								<td class="input_txt">
									<?php echo form_dropdown('super_type', $super, set_value('super_type'), 'id="super" onChange="check(this)" class="span3"') . form_error('super_type', '<span class="req-error">', '</span>'); ?>
								</td>
							</tr>
							<tr >
								<td class="txt">Type of Leave</td>
								<td class="txt1">:</td>
								<td class="input_txt"><?php echo form_dropdown('sub', $type, set_value('sub'), 'id="annual" class="span3"') . form_error('sub', '<span class="req-error">', '</span>'); ?></td>
							</tr>
							<tr >
								<td class="txt">Sub Type of Leave</td>
								<td class="txt1">:</td>
								<td class="input_txt"><?php echo form_dropdown('sub_sub', $sub_type, set_value('sub_sub'), 'id="annual1"  class="span3"') . form_error('sub_sub', '<span class="req-error">', '</span>'); ?></td>
							</tr>
							<tr>
								<td class="txt">Description</td>
								<td class="txt1">:</td>
								<!--This is catch up text file -->
								<td class="input_txt"><?php
									echo form_textarea($desc_catchup, '', 'style="max-height:60px; max-width:255px; min-height:60px; min-width:255px;" id="catchup" disabled="disabled"') . form_error('desc_up', '<span class="req-error">', '</span>');
									?></td>
							</tr>
							<tr>
								<td class="txt">Working On<span class="star">*</span></td>
								<td class="txt1">:</td>
								<td class="input_txt">
									<?php
									echo form_input($working_on, '', 'id="workingon" class="span3" disabled="disabled"') . form_error('working_on', '<span class="req-error">', '</span>');
									?>
									<input type="hidden" name="working_on" id="working_on_alternate" />
								</td>
							</tr>
							<tr>
								<td class="txt">Catch On<span class="star">*</span></td>
								<td class="txt1">:</td>
								<td class="input_txt">
									<?php echo form_input($catch_on, '', 'id="catch_on" class="span3" disabled="disabled"') . form_error('catchup_on', '<span class="req-error">', '</span>');
									?>
									<input type="hidden" name="catch_on_date" id="catchup_on_alternate" />
								</td>
							</tr>
							<!--the end of catch up file-->
							<tr>
								<td class="txt">Time Duration<span class="star">*</span></td>
								<td class="txt1">:</td>
								<td class="input_txt"><?php 
								echo form_input('duration', set_value('duration'), 'class="span3"') . form_error('duration', '<span class="req-error">', '</span>'); ?>
								</td>
							</tr>
							<tr>
								<td class="txt">Start Date<span class="star">*</span></td>
								<td class="txt1">:</td>
								<td class="input_txt">
									<?php echo form_input($start_date, '', 'id="startdate" class="span3"') . form_error('s_date', '<span class="req-error">', '</span>');
									?>
									<input type="hidden" name="s_date" id="start_alternate" />
								</td>
							</tr>
							<tr>
								<td class="txt">End Date<span class="star">*</span></td>
								<td class="txt1">:</td>
								<td class="input_txt">
									<?php echo form_input($end_date, '', 'id="enddate" class="span3"') . form_error('e_date', '<span class="req-error">', '</span>'); ?>
									<input type="hidden" name="e_date" id="end_alternate" />
								</td>
							</tr>
							<tr>
								<td class="txt">Reasons<span class="star">*</span></td>
								<td class="txt1">:</td>
								<td class="input_txt">
									<?php echo form_textarea($reason, '', 'style="max-height:100px; max-width:255px; min-height:100px; min-width:255px;"') . form_error('reason', '<span class="req-error">', '</span>');
									?>
								</td>
							</tr>
							<tr>
								<td colspan="2"></td>
								<td>
									<?php
									$submit = array('name' => 'btn_do_request', 'value' => 'Request');
									echo anchor('manager/home', form_button('btn_Cancel', 'Cancel', 'class="btn btn-info"'), 'style="text-decoration:none;"') . nbs(2) . form_submit($submit, '', ' class="btn btn-info" ');
									?>
								</td>
							</tr>
						</tbody>
                    </table>
                </div>
            </div>
        </div>
		<?php echo form_close(); ?>
    </body>
</html>